Distribution and persistence as aspects

نویسندگان

  • Sérgio Soares
  • Paulo Borba
  • Eduardo Laureano
چکیده

aspect ServerSide { abstract pointcut facadeMainExecution(); abstract Remote initFacadeInstance(); abstract String getSystemName(); abstract String getServerName(); Those abstract methods and pointcut are implemented by system specific aspects. The abstract aspect also defines and around advice that uses the abstract methods to export the facade instance and make it remotely available. Copyright c © 2000 John Wiley & Sons, Ltd. Softw. Pract. Exper. 2000; 00:1–6 Prepared using speauth.cls DISTRIBUTION AND PERSISTENCE AS ASPECTS 11 void around(): facadeMainExecution() { try { Remote facade = initFacadeInstance(); String systemName = getSystemName(); UnicastRemoteObject.exportObject(facade); java.rmi.Naming.rebind("/"+ systemName, facade); } catch (RemoteException rmiEx) { ... } } catch (MalformedURLException rmiEx) { ... } } } In fact, this advice replaces the entire original main method, and therefore, the original behavior if despised. However, usually, the main method of a facade class might not even exist or it may only has tests over the system. It is very unusual a main method to be executed while the system is being executed. Defining a concrete aspect As previously mentioned, RMI remote objects must implement a remote interface. Hence, the concrete server-side aspect has to modify the facade class (HWFacade) to implement a corresponding remote interface (IRemoteFacade), which extends the RMI remote interface (java.rmi.Remote). Since the IRemoteFacade interface is only needed to implement distribution, its relationship with the system facade was implemented by the distribution aspect. This is done by using AspectJ’s declare parents construct: aspect HWServerSide extends ServerSide { declare parents: HWFacade implements IRemoteFacade; The IRemoteFacade interface, which is distribution specific code, was part of the pure Java version of the system, so we did not have to implement it again. In the AspectJ version of the system, this interface is specific and auxiliary to the distribution aspects, so it was grouped with the other auxiliary types. Besides extending RMI’s Remote interface, this interface contains the signatures of the facade public methods, however, adding the java.rmi.RemoteException in their throws clauses. This exception is used by RMI in order to indicate several kinds of configuration problems and remote communication failures. The concrete aspect must implement the abstract members of the abstract aspect in order to specialize it to a specific system. The methods Remote initFacadeInstance() { return HWFacade.getInstance(); } String getSystemName() { return "HealthWatcherSystem"; } String getServerName() { return /* server IP or DNS address */ }

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

مفهوم ماندگاری در معماری اسلامی و مقایسه‌ی آن با مفهوم پایداری در معماری معاصر

The present paper is extracted from a purposeful research aiming at pondering on the recondite meaning of persistence in Iranian architecture during Islamic era and comparing it to the concept of sustainability and contemporary sustainable architecture. It seems that the literature is poor in terms of causes and factors of persistence in Iranian architecture. The limited literature in this area...

متن کامل

Aspect Discovery and Usage with regards to Persistence and Distribution An Annotated Bibliography

The concerns of persistence and distribution commonly surface in many non-trivial applications are often cross-cutting in nature. It is widely accepted that both concerns can be effectively localized through aspect-oriented techniques, however, there exists very little real-world examples of this phenomenon. How can aspects help in building new distributed systems? How can aspects be used to de...

متن کامل

An Aspect-Oriented Distribution Service

This project explores the possibility of providing distributed systems services through Aspect-Oriented Programming (AOP). AOP is a relatively new movement in software engineering. It allows the separation of aspects of an application from the implementation of the functional system model. AspectJ, the most general-purpose AOP language currently available, is used to present several distributio...

متن کامل

Generalized half-normal distribution: Model and properties

In this article new generalization of half-normal distribution as the half generalized normal distribution is introduced.‎ This distribution, contains the half-normal distribution as special case. ‎We provide mathematical properties of this distribution. We also derive the pdf, cdf, -th moment, the asymmetry and kurtosis coefficients and the moment generating function. We discuss some inferenti...

متن کامل

Specifying Persistence in Platform Independent Models

Object persistence is addressed by many standards. Unfortunately, those standards are often specific to technology, middleware and programming languages. These not only complicate the model but also limit the flexibility in changing from one standard to another. This paper describes a Platform Independent Model (PIM) that supports object persistence and shows how the PIM is transformed into dif...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Softw., Pract. Exper.

دوره 36  شماره 

صفحات  -

تاریخ انتشار 2006